home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
Dev
/
Oberon
/
source
/
amiga
/
CardRes.mod
< prev
next >
Wrap
Text File
|
1995-06-29
|
6KB
|
242 lines
(**************************************************************************
$RCSfile: CardRes.mod $
Description: Interface to card.resource
Created by: fjc (Frank Copeland)
$Revision: 3.7 $
$Author: fjc $
$Date: 1995/06/04 23:13:14 $
Includes Release 40.15
(C) Copyright 1990-1993 Commodore-Amiga, Inc.
All Rights Reserved
Oberon-A Interface Copyright © 1994-1995, Frank Copeland.
This file is part of the Oberon-A Interface.
See Oberon-A.doc for conditions of use and distribution.
*************************************************************************)
<* STANDARD- *>
MODULE [2] CardRes;
IMPORT SYS := SYSTEM, e := Exec, s := Sets;
(*
** $VER: card.h 1.11 (14.12.92)
**
** card.resource include file
*)
CONST
cardResName * = "card.resource";
TYPE
(* Structures used by the card.resource *)
CardHandlePtr * = POINTER TO CardHandle;
CardHandle * = RECORD
node * : e.Node;
removed * : e.InterruptPtr;
inserted * : e.InterruptPtr;
status * : e.InterruptPtr;
flags * : s.SET8;
END;
DeviceTDataPtr * = POINTER TO DeviceTData;
DeviceTData * = RECORD
size * : e.ULONG; (* Size in bytes *)
speed * : e.ULONG; (* Speed in nanoseconds *)
type * : SHORTINT; (* Type of card *)
flags * : s.SET8; (* Other flags *)
END;
CardMemoryMapPtr * = POINTER TO CardMemoryMap;
CardMemoryMap * = RECORD
commonMemory * : e.APTR;
attributeMemory * : e.APTR;
ioMemory * : e.APTR;
(* Extended for V39 - These are the size of the memory spaces above *)
commonMemSize * : e.ULONG;
attributeMemSize * : e.ULONG;
ioMemSize * : e.ULONG;
END;
CONST
(* CardHandle.cah_CardFlags for OwnCard() function *)
resetRemove * = 0;
ifAvailable * = 1;
delayOwnership * = 2;
postStatus * = 3;
(* ReleaseCreditCard() function flags *)
removeHandle * = 0;
(* ReadStatus() return flags *)
statusbCCDET * = 6;
statusbBVD1 * = 5;
statusbSC * = 5;
statusbBVD2 * = 4;
statusbDA * = 4;
statusbWR * = 3;
statusbBSY * = 2;
statusbIRQ * = 2;
(* CardProgramVoltage() defines *)
voltage0v * = 0; (* Set to default; may be the same as 5V *)
voltage5v * = 1;
voltage12v * = 2;
(* CardMiscControl() defines *)
enableDigAudio * = 1;
disableWP * = 3;
(*
* New CardMiscControl() bits for V39 card.resource. Use these bits to set,
* or clear status change interrupts for BVD1/SC, BVD2/DA, and BSY/IRQ.
* Write-enable/protect change interrupts are always enabled. The defaults
* are unchanged (BVD1/SC is enabled, BVD2/DA is disabled, and BSY/IRQ is enabled).
*
* IMPORTANT -- Only set these bits for V39 card.resource or greater (check
* resource base VERSION)
*
*)
intbSetClr * = 7;
intbBVD1 * = 5;
intbSC * = 5;
intbBVD2 * = 4;
intbDA * = 4;
intbBSY * = 2;
intbIRQ * = 2;
(* CardInterface() defines *)
interfaceAmiga0 * = 0;
(*
* Tuple for Amiga execute-in-place software (e.g., games, or other
* such software which wants to use execute-in-place software stored
* on a credit-card, such as a ROM card).
*
* See documentatin for IfAmigaXIP().
*)
cisTplAmigaXIP * = 091H;
TYPE
TPAmigaXIPPtr * = POINTER TO TPAmigaXIP;
TPAmigaXIP * = RECORD
code * : SHORTINT;
link * : SHORTINT;
loc * : ARRAY 4 OF SHORTINT;
flags * : s.SET8;
resrv * : SHORTINT;
END;
CONST
(*
; The XIPFLAGB_AUTORUN bit means that you want the machine
; to perform a reset if the execute-in-place card is inserted
; after DOS has been started. The machine will then reset,
; and execute your execute-in-place code the next time around.
;
; NOTE -- this flag may be ignored on some machines, in which
; case the user will have to manually reset the machine in the
; usual way.
*)
autoRun * = 0;
(**-- Library Base variable --------------------------------------------*)
(*
* You have to put a pointer to the card.resource here to use the cia
* procedures:
*)
VAR base* : e.APTR;
(**-- Library Functions ------------------------------------------------*)
(*
** $VER: cardres_protos.h 1.2 (8.9.92)
*)
PROCEDURE OwnCard* [base,-6]
( handle [9] : CardHandlePtr )
: CardHandlePtr;
PROCEDURE ReleaseCard* [base,-12]
( handle [9] : CardHandlePtr;
flags [0] : e.ULONG );
PROCEDURE GetCardMap* [base,-18] ()
: CardMemoryMapPtr;
PROCEDURE BeginCardAccess* [base,-24]
( handle [9] : CardHandlePtr )
: BOOLEAN;
PROCEDURE EndCardAccess* [base,-30]
( handle [9] : CardHandlePtr )
: BOOLEAN;
PROCEDURE ReadCardStatus* [base,-36] ()
: e.UBYTE;
PROCEDURE CardResetRemove* [base,-42]
( handle [9] : CardHandlePtr;
flag [0] : e.ULONG )
: BOOLEAN;
PROCEDURE CardMiscControl* [base,-48]
( handle [9] : CardHandlePtr;
controlBits [1] : s.SET8 )
: s.SET8;
PROCEDURE CardAccessSpeed* [base,-54]
( handle [9] : CardHandlePtr;
nanoseconds [0] : e.ULONG )
: e.ULONG;
PROCEDURE CardProgramVoltage* [base,-60]
( handle [9] : CardHandlePtr;
voltage [0] : e.ULONG )
: LONGINT;
PROCEDURE CardResetCard* [base,-66]
( handle [9] : CardHandlePtr )
: BOOLEAN;
PROCEDURE CopyTuple* [base,-72]
( handle [9] : CardHandlePtr;
buffer [8] : ARRAY OF SYS.BYTE;
tuplecode [1] : e.ULONG;
size [0] : e.ULONG )
: BOOLEAN;
PROCEDURE DeviceTuple* [base,-78]
( tupleData [8] : e.APTR;
storage [9] : DeviceTDataPtr )
: e.ULONG;
PROCEDURE IfAmigaXIP* [base,-84]
( handle [10] : CardHandlePtr )
: e.ResidentPtr;
PROCEDURE CardForceChange* [base,-90] ()
: BOOLEAN;
PROCEDURE CardChangeCount* [base,-96] ()
: e.ULONG;
PROCEDURE CardInterface* [base,-102] ()
: e.ULONG;
BEGIN base := NIL
END CardRes.